<?php include (TEMPLATEPATH . '/header2.php'); ?>

<script>
  var slider = '';
  $(document).ready(function(){
    $('#menu-faq').addClass('active');
    $('#faq .faq-menu ul li:nth-child(1)').addClass('active');
    
    slider = $('#faq .slider').bxSlider({
        controls: false,
        mode: 'vertical'
      });
      
    $('#faq .faq-menu ul li').click(function(){
      $('#faq .faq-menu ul li').removeClass('active');
      $(this).addClass('active');
    
      var index = $('#faq .faq-menu ul li').index($(this));
      slider.goToSlide(index);
    });
  });
</script>

<div id="faq" class="section">
  <div class="faq-menu">
    <h3>F.A.Q</h3>
    
    <ul>
      <?php
        $args = array(
          'numberposts'     => -1,
          'category'        => 4,
        );
        $posts = get_posts($args);
        foreach($posts as $post){
      ?>
      <li><a href="javascript:void(0)" alt="<?php echo $post->post_name; ?>"><?php echo $post->post_title; ?></a></li>
      <?php } ?>
    </ul>
  </div>
  <div class="faq-content">
    <div class="slider">
      <?php
        $args = array(
          'numberposts'     => -1,
          'category'        => 4,
        );
        $posts = get_posts($args);
        foreach($posts as $post){
        $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
      ?>
      <div>
        <h5 class="title"><?php echo $post->post_title; ?></h5>
        <img src="<?php echo $feat_image; ?>" />
        <?php echo $post->post_content; ?>
      </div>
      <?php } ?>
    </div>
  </div>
</div>

<?php get_footer(); ?>
